﻿@{
    ViewBag.Title = "Async";
    Layout = null;
}


<input id="key" type="text" value="" /><input type="submit" onclick="long_polling()" />
<div id="logs"></div>
<script type="text/javascript">

    function long_polling() {
        var key = $('#key').val();
        $.getJSON("@Url.Action("LongPolling", "Asy")" + "?key=" + key, function (data) {
            if (data) {
                $('#logs').append(data.Data + "<br/>");
            }
            long_polling();
        });
    }


</script>

